﻿package com.designoutput.ui.controls
{
	import flash.text.*;

	public class Literal extends TextField
	{

		public function Literal(text:String="", autoSize:Boolean=false, color:uint=3355443)
		{
			this.defaultTextFormat=new TextFormat("Trebuchet MS,Verdana,Helvetica,San-serif", 12, color, true, null, null, null, null, autoSize ? ("right") : ("left"));
			this.autoSize=autoSize ? (TextFieldAutoSize.RIGHT) : (TextFieldAutoSize.LEFT);
			this.height=15;
			this.multiline=false;
			this.selectable=false;
			this.text=text;
		}

		public override function setTextFormat(format:TextFormat, beginIndex:int=-1, endIndex:int=-1):void
		{
			if (format)
			{
				format.size=format.size < 12 ? 12 : format.size;
			}
			super.setTextFormat(format, beginIndex, endIndex);
		}

	}
}
